home *** CD-ROM | disk | FTP | other *** search
/ Hottest 6 / Hottest 6 (1996)(PDSoft)[!].iso / software / videoutils / h-m / mainactor / rexx / relief_adpro.ma < prev    next >
Text File  |  1978-11-24  |  3KB  |  129 lines

  1. /*
  2.  *
  3.  *     Relief V 1.0, 1993 Markus Moenig
  4.  *
  5.  *     Creates a new project with an relief effect from your source project.
  6.  *     Needs AdPro !!
  7.  *     The new project gets the name of the source project + ".new"
  8.  *     and is also converted to the saver module type of the source project.
  9.  *
  10.  *     The loader/saver of the source project can be either picture
  11.  *     or animation modules.
  12.  *
  13.  *     A new project will be opened for the resulting pictures/animation.
  14.  *
  15.  *     Thanks to Lutz Fauska for the original relief script.
  16.  */
  17.  
  18. OPTIONS RESULTS
  19.  
  20. ADDRESS MAINACTOR 
  21.  
  22. ScreenToFront
  23. PrintAndStoreTXT "Relief V1.0 ..."
  24.  
  25. IF ~SHOW('P','ADPro') THEN DO  /* if not allready running, start adpro */
  26.     ADDRESS MAINACTOR PrintTXT "Invoking AdPro ..."
  27.     ADDRESS COMMAND 'run >NIL: <NIL: adpro:adpro BEHIND MAXMEM=1000000'
  28.     ADDRESS COMMAND Wait 5
  29. END  
  30.  
  31. ADDRESS MAINACTOR
  32.  
  33. GetSPName
  34.  
  35. IF rc = 0 THEN DO                          /* check if project loaded */
  36.  
  37.     PARSE VAR RESULT firstname secondname .  /* store name of the animation */
  38.                                              /* or the names of the picture list */
  39.     ScreenToFront
  40.  
  41.     DeSelectAll
  42.  
  43.     GetSPSaver
  44.     PARSE VAR RESULT savertype savername .   /* store type, name of saver module */
  45.  
  46.                                            /* Store general infos of the project */
  47.     GetSPInfo
  48.     PARSE VAR RESULT width height colors pics caching loop cpf .
  49.  
  50.     IF savertype = "PIC" THEN
  51.         picformat=savername
  52.     ELSE DO
  53.         picformat=IFF
  54.         SetSPSaver PIC picformat
  55.     END
  56.     
  57.     ADDRESS "ADPro"
  58.         LFormat "Universal"
  59.         PSTATUS UNLOCKED
  60.         ORIENTATION PORTRAIT
  61.         SFormat picformat
  62.  
  63.     ADDRESS MAINACTOR
  64.  
  65.     newname = firstname || ".new"            /* new name = old one + ".new" */
  66.  
  67.     SelectAll
  68.     
  69.     saveargs=newname
  70.         
  71.     Save saveargs                            /* Save Pictures */
  72.  
  73.     DO i=1 to pics                           /* Scale all pics */
  74.  
  75.         actualpic=newname || "." || Right("00000" || i, 5)
  76.     PrintTxt "ADPro adds relief to Picture" i
  77.  
  78.         ADDRESS "ADPro"    
  79.         Load actualpic
  80.         RENDER_TYPE colors
  81.         OPERATOR "NEGATIVE"
  82.         Load actualpic 1 1 50 -1 -1 -1
  83.         OPERATOR "COLOR_TO_GRAY"
  84.         CONTRAST 50
  85.         OPERATOR "NEGATIVE"
  86.         Execute    
  87.         Save actualpic IMAGE
  88.  
  89.         ADDRESS MAINACTOR
  90.  
  91.     END
  92.  
  93.     IF caching = "CACHING=YES" THEN                 /* Was the old project cached ? */
  94.         
  95.         OpenNewProject "CACHING"               /* If yes new project is also cached */
  96.     
  97.     ELSE 
  98.         
  99.         OpenNewProject                         /* If not new project is not cached */
  100.  
  101.     SetSPLoader PIC picformat                /* Set the new projects loader module */
  102.  
  103.     firstpic=newname || "." || Right("00000" || 1, 5)
  104.     lastpic=newname || "." || Right("00000" || pics, 5)
  105.  
  106.     LoadProject firstpic lastpic             /* Load picture list */
  107.  
  108.     SetSPSaver savertype savername
  109.  
  110.     IF savertype = "ANIM" THEN DO            /* If we wanted a new animation, */
  111.                                              /* we have to build it */
  112.         SelectAll
  113.         saveargs=newname || " " || cpf || " " || loop
  114.         Save saveargs
  115.         UnloadProject
  116.         
  117.         DO i=1 TO pics                         /* delete temporary pics */
  118.             actualpic=newname || "." || Right("00000" || i, 5)
  119.             PrintTxt "Delete " || actualpic
  120.             ADDRESS COMMAND    "delete " || actualpic || "#?"
  121.         END
  122.         
  123.         SetSPLoader savertype savername
  124.         LoadProject newname
  125.     END
  126.     
  127.     PrintAndStoreTXT "READY !!!!"
  128. END
  129.